package com.example.lizhixin.object_three_team.Fragment;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.lizhixin.object_three_team.Base.BaseFragment;
import com.example.lizhixin.object_three_team.MainActivity;
import com.example.lizhixin.object_three_team.R;
import com.example.lizhixin.object_three_team.Uitls.HttpUtils;
import com.example.lizhixin.object_three_team.Uitls.ThreadUtils;

import java.io.IOException;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Response;

/**
 * A simple {@link Fragment} subclass.
 */
public class ChoicenessFragment extends BaseFragment {
    private TextView cosTxt;

    public ChoicenessFragment() {
    }

    @Override
    protected int attachLayoutRes() {
        return R.layout.fragment_choiceness;
    }

    @Override
    protected void initView() {
        cosTxt = getActivity().findViewById(R.id.cos_txt);
    }
    @Override
    protected void initData() {
        ThreadUtils.runOnsubThread(new Runnable() {
            @Override
            public void run() {
                Call httpGet = HttpUtils.getHttpGet("http://www.qubaobei.com/ios/cf/dish_list.php?stage_id=1&limit=20&page=1");
                httpGet.enqueue(new Callback() {
                    @Override
                    public void onFailure(Call call, IOException e) {

                    }

                    @Override
                    public void onResponse(Call call, Response response) throws IOException {
                        String string = response.body().string();
                    }
                });
            }
        });
        cosTxt.setText("");
    }
}
